﻿using System;
using System.Xml.Serialization;
using Kiva7.Translations;

namespace Kiva7.DataClasses
{
    public class Team
    {
        [XmlElement("id")]
        public int TeamId { get; set; }

        [XmlElement("shortname")]
        public string ShortName { get; set; }

        [XmlElement("name")]
        public string Name { get; set; }

        [XmlElement("category")]
        public string Category { get; set; }

        [XmlElement("image")]
        public Image Image { get; set; }

        [XmlElement("whereabouts")]
        public string WhereAbouts { get; set; }

        [XmlElement("loan_because")]
        public string LoanBecause { get; set; }

        private Translation _LoanBecauseTranslation;
        [XmlIgnore]
        public Translation LoanBecauseTranslation
        {
            get
            {
                if (_LoanBecauseTranslation == null)
                {
                    _LoanBecauseTranslation = new Translation(LoanBecause);
                }
                return _LoanBecauseTranslation;
            }
        }


        [XmlElement("description")]
        public string Description { get; set; }

        private Translation _descriptionTranslation;
        [XmlIgnore]
        public Translation DescriptionTranslation
        {
            get
            {
                if (_descriptionTranslation == null)
                {
                    _descriptionTranslation = new Translation(Description);
                }
                return _descriptionTranslation;
            }
        }


        [XmlElement("website_url")]
        public string WebsiteUrl { get; set; }

        [XmlElement("team_since")]
        public DateTime? TeamSince { get; set; }

        [XmlElement("membership_type")]
        public string MembershipType { get; set; }

        [XmlElement("member_count")]
        public int MemberCount { get; set; }

        [XmlElement("loan_count")]
        public int LoanCount { get; set; }

        [XmlElement("loaned_amount")]
        public double LoanedAmount { get; set; }

    }
}
